<!DOCTYPE html><html><head>
  <meta charset="utf-8">
  <base data-ice="baseUrl" href="/v4/../../">
  <title data-ice="title">QueryInterface |  Sequelize | The node.js ORM for PostgreSQL, MySQL, SQLite and MSSQL API Document</title>
  <link type="text/css" rel="stylesheet" href="/v4/css/style.css">
  <link type="text/css" rel="stylesheet" href="/v4/css/prettify-tomorrow.css">
  <script src="/v4/script/prettify/prettify.js"></script>
  
  
  <script src="/v4/script/manual.js"></script>
<script data-ice="userScript" src="/v4/user/script/0-script.js"></script>
<link data-ice="userStyle" rel="stylesheet" href="/v4/user/css/0-style.css">
<link data-ice="userStyle" rel="stylesheet" href="/v4/user/css/1-theme.css">
<link rel="shortcut icon" type="image/x-icon" href="/v4/favicon.ico"><meta name="robots" content="noindex"></head>
<body class="layout-container" data-ice="rootContainer">

<header><a href="/v4/"><img src="/v4/manual/asset/logo-small.png" class="header-logo"></a>
  <a href="/v4/./">Home</a>
  
  <a href="/v4/identifiers.html">Reference</a>
  <a href="/v4/source.html">Source</a>
  
  <a data-ice="repoURL" href="https://github.com/sequelize/sequelize.git" class="repo-url-github">Repository</a><a href="https://sequelize.org/slack" class="slack-link"><img class="slack-logo" src="/v4/manual/asset/slack.svg">Join us on Slack</a>
  <div class="search-box">
  <span>
    <img src="/v4/./image/search.png">
    <span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
  </span>
    <ul class="search-result"></ul>
  </div>
</header>

<nav class="navigation" data-ice="nav"><div>
  <ul>
    
  <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/model.js~Model.html">Model</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html">QueryInterface</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/sequelize.js~Sequelize.html">Sequelize</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/transaction.js~Transaction.html">Transaction</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="/v4/variable/index.html#static-variable-DataTypes">DataTypes</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="/v4/variable/index.html#static-variable-Deferrable">Deferrable</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="/v4/variable/index.html#static-variable-Op">Op</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="/v4/variable/index.html#static-variable-QueryTypes">QueryTypes</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="/v4/variable/index.html#static-variable-TableHints">TableHints</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">associations</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/associations/base.js~Association.html">Association</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/associations/belongs-to-many.js~BelongsToMany.html">BelongsToMany</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/associations/belongs-to.js~BelongsTo.html">BelongsTo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/associations/has-many.js~HasMany.html">HasMany</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/associations/has-one.js~HasOne.html">HasOne</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">errors</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~AccessDeniedError.html">AccessDeniedError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~AssociationError.html">AssociationError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~BaseError.html">BaseError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~BulkRecordError.html">BulkRecordError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~ConnectionError.html">ConnectionError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~ConnectionRefusedError.html">ConnectionRefusedError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~ConnectionTimedOutError.html">ConnectionTimedOutError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~DatabaseError.html">DatabaseError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~EagerLoadingError.html">EagerLoadingError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~EmptyResultError.html">EmptyResultError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~ExclusionConstraintError.html">ExclusionConstraintError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~ForeignKeyConstraintError.html">ForeignKeyConstraintError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~HostNotFoundError.html">HostNotFoundError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~HostNotReachableError.html">HostNotReachableError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~InstanceError.html">InstanceError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~InvalidConnectionError.html">InvalidConnectionError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~OptimisticLockError.html">OptimisticLockError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~QueryError.html">QueryError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~SequelizeScopeError.html">SequelizeScopeError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~TimeoutError.html">TimeoutError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~UniqueConstraintError.html">UniqueConstraintError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~UnknownConstraintError.html">UnknownConstraintError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~ValidationError.html">ValidationError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v4/class/lib/errors/index.js~ValidationErrorItem.html">ValidationErrorItem</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">utils</div><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="/v4/function/index.html#static-function-isImmutable">isImmutable</a></span></span></li>
</ul>
</div>
</nav>

<div class="content" data-ice="content"><div class="header-notice">
  <div data-ice="importPath" class="import-path"><pre class="prettyprint"><code data-ice="importPathCode"></code></pre></div>
  <span data-ice="access">public</span>
  <span data-ice="kind">class</span>
  
  
  
  <span data-ice="source">| <span><a href="/v4/file/lib/query-interface.js.html#lineNumber19">source</a></span></span>
</div>

<div class="self-detail detail">
  <h1 data-ice="name">QueryInterface</h1>

  

  
  
  
  
  
  
  
  
  

  
  
  <div class="description" data-ice="description"><p>The interface that Sequelize uses to talk to all databases</p>
</div>
  

  

  

  

  
</div>





<div data-ice="methodSummary"><h2>Method Summary</h2><table class="summary" data-ice="summary">
  <thead><tr><td data-ice="title" colspan="3">Public Methods</td></tr></thead>
  <tbody>
  
  <tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-addColumn">addColumn</a></span></span><span data-ice="signature">(table: <span>String</span>, key: <span>String</span>, attribute: <span>Object</span>, options: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Add a new column into a table</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-addConstraint">addConstraint</a></span></span><span data-ice="signature">(tableName: <span>String</span>, attributes: <span>Array</span>, options: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Add constraints to table</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-addIndex">addIndex</a></span></span><span data-ice="signature">(tableName: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Add index to a column</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-bulkDelete">bulkDelete</a></span></span><span data-ice="signature">(tableName: <span>String</span>, identifier: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Delete records from a table</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-bulkInsert">bulkInsert</a></span></span><span data-ice="signature">(tableName: <span>String</span>, records: <span>Array</span>, options: <span>Object</span>, fieldMappedAttributes: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Insert records into a table</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-changeColumn">changeColumn</a></span></span><span data-ice="signature">(tableName: <span>String</span>, attributeName: <span>String</span>, dataTypeOrOptions: <span>Object</span>, options: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Change a column definition</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-createFunction">createFunction</a></span></span><span data-ice="signature">(functionName: <span>String</span>, params: <span>Array</span>, returnType: <span>String</span>, language: <span>String</span>, body: <span>String</span>, optionsArray: <span>Array</span>, options: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Create SQL function</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-createSchema">createSchema</a></span></span><span data-ice="signature">(schema: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Creates a schema</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-createTable">createTable</a></span></span><span data-ice="signature">(tableName: <span>String</span>, attributes: <span>Object</span>, options: <span>Object</span>, model: <span><a href="/v4/class/lib/model.js~Model.html">Model</a></span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Create a table with given set of attributes</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-describeTable">describeTable</a></span></span><span data-ice="signature">(tableName: <span>String</span>, options: <span>Object</span>): <span>Promise</span>&lt;<span>Object</span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Describe a table structure</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-dropAllSchemas">dropAllSchemas</a></span></span><span data-ice="signature">(options: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Drop all schemas</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-dropAllTables">dropAllTables</a></span></span><span data-ice="signature">(options: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Drop all tables from database</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-dropFunction">dropFunction</a></span></span><span data-ice="signature">(functionName: <span>String</span>, params: <span>Array</span>, options: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Drop SQL function</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-dropSchema">dropSchema</a></span></span><span data-ice="signature">(schema: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Drops a schema</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-dropTable">dropTable</a></span></span><span data-ice="signature">(tableName: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Drops a table from database</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-getForeignKeyReferencesForTable">getForeignKeyReferencesForTable</a></span></span><span data-ice="signature">(tableName: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Get foreign key references details for the table.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-removeColumn">removeColumn</a></span></span><span data-ice="signature">(tableName: <span>String</span>, attributeName: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Remove a column from table</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-removeConstraint">removeConstraint</a></span></span><span data-ice="signature">(tableName: <span>String</span>, constraintName: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-removeIndex">removeIndex</a></span></span><span data-ice="signature">(tableName: <span>String</span>, indexNameOrAttributes: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Remove an already existing index from a table</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-renameColumn">renameColumn</a></span></span><span data-ice="signature">(tableName: <span>String</span>, attrNameBefore: <span>String</span>, attrNameAfter: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Rename a column</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-renameFunction">renameFunction</a></span></span><span data-ice="signature">(oldFunctionName: <span>String</span>, params: <span>Array</span>, newFunctionName: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Rename SQL function</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-renameTable">renameTable</a></span></span><span data-ice="signature">(before: <span>String</span>, after: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Renames a table</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-showAllSchemas">showAllSchemas</a></span></span><span data-ice="signature">(options: <span>Object</span>): <span>Promise</span>&lt;<span>Array</span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Show all schemas</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          <span data-ice="name"><span><a href="/v4/class/lib/query-interface.js~QueryInterface.html#instance-method-upsert">upsert</a></span></span><span data-ice="signature">(tableName: <span>String</span>, insertValues: <span>Object</span>, updateValues: <span>Object</span>, where: <span>Object</span>, model: <span><a href="/v4/class/lib/model.js~Model.html">Model</a></span>, options: <span>Object</span>): <span>Promise</span>&lt;<span>created</span>, <span>primaryKey</span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Upsert</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
</tbody>
</table>
</div>







<div data-ice="methodDetails"><h2 data-ice="title">Public Methods</h2>

<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-addColumn">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">addColumn</span><span data-ice="signature">(table: <span>String</span>, key: <span>String</span>, attribute: <span>Object</span>, options: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber518">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Add a new column into a table</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">table</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Table to add column to</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">key</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Column name</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">attribute</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Attribute definition</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Query options</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-addConstraint">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">addConstraint</span><span data-ice="signature">(tableName: <span>String</span>, attributes: <span>Array</span>, options: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber838">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Add constraints to table</p>
<p>Available constraints:</p>
<ul>
<li>UNIQUE</li>
<li>DEFAULT (MSSQL only)</li>
<li>CHECK (MySQL - Ignored by the database engine )</li>
<li>FOREIGN KEY</li>
<li>PRIMARY KEY</li>
</ul>
<p>UNIQUE</p>
<pre><code class="lang-js"><code class="source-code prettyprint">queryInterface.addConstraint('Users', ['email'], {
  type: 'unique',
  name: 'custom_unique_constraint_name'
});</code>
</code></pre>
<p>CHECK</p>
<pre><code class="lang-js"><code class="source-code prettyprint">queryInterface.addConstraint('Users', ['roles'], {
  type: 'check',
  where: {
     roles: ['user', 'admin', 'moderator', 'guest']
  }
});</code>
</code></pre>
<p>Default - MSSQL only</p>
<pre><code class="lang-js"><code class="source-code prettyprint">queryInterface.addConstraint('Users', ['roles'], {
   type: 'default',
   defaultValue: 'guest'
});</code>
</code></pre>
<p>Primary Key</p>
<pre><code class="lang-js"><code class="source-code prettyprint">queryInterface.addConstraint('Users', ['username'], {
   type: 'primary key',
   name: 'custom_primary_constraint_name'
});</code>
</code></pre>
<p>Foreign Key</p>
<pre><code class="lang-js"><code class="source-code prettyprint">queryInterface.addConstraint('Posts', ['username'], {
  type: 'foreign key',
  name: 'custom_fkey_constraint_name',
  references: { //Required field
    table: 'target_table_name',
    field: 'target_column_name'
  },
  onDelete: 'cascade',
  onUpdate: 'cascade'
});</code>
</code></pre>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">tableName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Table name where you want to add a constraint</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">attributes</td>
      <td data-ice="type"><span>Array</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Array of column names to apply the constraint over</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>An object to define the constraint name, type etc</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" data-depth="1">options.type</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Type of constraint. One of the values in available constraints(case insensitive)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" data-depth="1">options.name</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Name of the constraint. If not specified, sequelize automatically creates a named constraint based on constraint type, table &amp; column names</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" data-depth="1">options.defaultValue</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The value for the default constraint</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" data-depth="1">options.where</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Where clause/expression for the CHECK constraint</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" data-depth="1">options.references</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Object specifying target table, column name to create foreign key constraint</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" data-depth="2">options.references.table</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Target table name</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" data-depth="2">options.references.field</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Target column name</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-addIndex">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">addIndex</span><span data-ice="signature">(tableName: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber648">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Add index to a column</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">tableName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Table name to add index on</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" data-depth="1">options.fields</td>
      <td data-ice="type"><span>Array</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>List of attributes to add index on</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" data-depth="1">options.unique</td>
      <td data-ice="type"><span>Boolean</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Create a unique index</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" data-depth="1">options.using</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Useful for GIN indexes</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" data-depth="1">options.type</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Type of index, available options are UNIQUE|FULLTEXT|SPATIAL</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" data-depth="1">options.name</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Name of the index. Default is &lt;table&gt;<em>&lt;attr1&gt;</em>&lt;attr2&gt;</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" data-depth="1">options.where</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Where condition on index, for partial indexes</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-bulkDelete">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">bulkDelete</span><span data-ice="signature">(tableName: <span>String</span>, identifier: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber1090">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Delete records from a table</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">tableName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Table name from where to delete records</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">identifier</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Where conditions to find records to delete</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-bulkInsert">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">bulkInsert</span><span data-ice="signature">(tableName: <span>String</span>, records: <span>Array</span>, options: <span>Object</span>, fieldMappedAttributes: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber1009">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Insert records into a table</p>
<pre><code class="lang-js"><code class="source-code prettyprint">queryInterface.bulkInsert('roles', [{
   label: 'user',
   createdAt: new Date(),
   updatedAt: new Date()
 }, {
   label: 'admin',
   createdAt: new Date(),
   updatedAt: new Date()
 }]);</code>
</code></pre>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">tableName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Table name to insert record to</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">records</td>
      <td data-ice="type"><span>Array</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>List of records to insert</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Various options, please see Model.bulkCreate options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">fieldMappedAttributes</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Various attributes mapped by field name</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-changeColumn">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">changeColumn</span><span data-ice="signature">(tableName: <span>String</span>, attributeName: <span>String</span>, dataTypeOrOptions: <span>Object</span>, options: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber564">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Change a column definition</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">tableName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Table name to change from</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">attributeName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Column name</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">dataTypeOrOptions</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Attribute definition for new column</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Query options</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-createFunction">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">createFunction</span><span data-ice="signature">(functionName: <span>String</span>, params: <span>Array</span>, returnType: <span>String</span>, language: <span>String</span>, body: <span>String</span>, optionsArray: <span>Array</span>, options: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber1241">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Create SQL function</p>
<pre><code class="lang-js"><code class="source-code prettyprint">queryInterface.createFunction(
  'someFunction',
  [
    {type: 'integer', name: 'param', direction: 'IN'}
  ],
  'integer',
  'plpgsql',
  'RETURN param + 1;',
  [
    'IMMUTABLE',
    'LEAKPROOF'
  ]
);</code>
</code></pre>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">functionName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Name of SQL function to create</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">params</td>
      <td data-ice="type"><span>Array</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>List of parameters declared for SQL function</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">returnType</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>SQL type of function returned value</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">language</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>The name of the language that the function is implemented in</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">body</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Source code of function</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">optionsArray</td>
      <td data-ice="type"><span>Array</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Extra-options for creation</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-createSchema">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">createSchema</span><span data-ice="signature">(schema: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber33">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Creates a schema</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">schema</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Schema name to create</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Query options</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-createTable">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">createTable</span><span data-ice="signature">(tableName: <span>String</span>, attributes: <span>Object</span>, options: <span>Object</span>, model: <span><a href="/v4/class/lib/model.js~Model.html">Model</a></span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber157">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Create a table with given set of attributes</p>
<pre><code class="lang-js"><code class="source-code prettyprint">queryInterface.createTable(
  'nameOfTheNewTable',
  {
    id: {
      type: Sequelize.INTEGER,
      primaryKey: true,
      autoIncrement: true
    },
    createdAt: {
      type: Sequelize.DATE
    },
    updatedAt: {
      type: Sequelize.DATE
    },
    attr1: Sequelize.STRING,
    attr2: Sequelize.INTEGER,
    attr3: {
      type: Sequelize.BOOLEAN,
      defaultValue: false,
      allowNull: false
    },
    //foreign key usage
    attr4: {
      type: Sequelize.INTEGER,
      references: {
        model: 'another_table_name',
        key: 'id'
      },
      onUpdate: 'cascade',
      onDelete: 'cascade'
    }
  },
  {
    engine: 'MYISAM',    // default: 'InnoDB'
    charset: 'latin1',   // default: null
    schema: 'public'     // default: public, PostgreSQL only.
  }
)</code>
</code></pre>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">tableName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Name of table to create</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">attributes</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Object representing a list of table attributes to create</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"></td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">model</td>
      <td data-ice="type"><span><a href="/v4/class/lib/model.js~Model.html">Model</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-describeTable">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">describeTable</span><span data-ice="signature">(tableName: <span>String</span>, options: <span>Object</span>): <span>Promise</span>&lt;<span>Object</span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber475">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Describe a table structure</p>
<p>This method returns an array of hashes containing information about all attributes in the table.</p>
<pre><code class="lang-js"><code class="source-code prettyprint">{
   name: {
     type:         'VARCHAR(255)', // this will be 'CHARACTER VARYING' for pg!
     allowNull:    true,
     defaultValue: null
   },
   isBetaMember: {
     type:         'TINYINT(1)', // this will be 'BOOLEAN' for pg!
     allowNull:    false,
     defaultValue: false
   }
}</code>
</code></pre>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">tableName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Query options</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span>&lt;<span>Object</span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-dropAllSchemas">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">dropAllSchemas</span><span data-ice="signature">(options: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber60">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Drop all schemas</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Query options</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-dropAllTables">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">dropAllTables</span><span data-ice="signature">(options: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber334">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Drop all tables from database</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"></td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" data-depth="1">options.skip</td>
      <td data-ice="type"><span>Array</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>List of table to skip</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-dropFunction">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">dropFunction</span><span data-ice="signature">(functionName: <span>String</span>, params: <span>Array</span>, options: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber1271">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Drop SQL function</p>
<pre><code class="lang-js"><code class="source-code prettyprint">queryInterface.dropFunction(
  'someFunction',
  [
    {type: 'varchar', name: 'param1', direction: 'IN'},
    {type: 'integer', name: 'param2', direction: 'INOUT'}
  ]
);</code>
</code></pre>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">functionName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Name of SQL function to drop</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">params</td>
      <td data-ice="type"><span>Array</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>List of parameters declared for SQL function</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-dropSchema">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">dropSchema</span><span data-ice="signature">(schema: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber47">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Drops a schema</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">schema</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Schema name to create</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Query options</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-dropTable">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">dropTable</span><span data-ice="signature">(tableName: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber291">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Drops a table from database</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">tableName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Table name to drop</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Query options</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-getForeignKeyReferencesForTable">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">getForeignKeyReferencesForTable</span><span data-ice="signature">(tableName: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber726">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Get foreign key references details for the table.</p>
<p>Those details contains constraintSchema, constraintName, constraintCatalog
tableCatalog, tableSchema, tableName, columnName,
referencedTableCatalog, referencedTableCatalog, referencedTableSchema, referencedTableName, referencedColumnName.
Remind: constraint informations won't return if it's sqlite.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">tableName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Query options</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-removeColumn">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">removeColumn</span><span data-ice="signature">(tableName: <span>String</span>, attributeName: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber537">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Remove a column from table</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">tableName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Table to remove column from</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">attributeName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Columns name to remove</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Query options</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-removeConstraint">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">removeConstraint</span><span data-ice="signature">(tableName: <span>String</span>, constraintName: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber878">source</a></span></span>
    </span>
  </h3>

  
  
  
  

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">tableName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Table name to drop constraint from</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">constraintName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Constraint name</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Query options</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-removeIndex">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">removeIndex</span><span data-ice="signature">(tableName: <span>String</span>, indexNameOrAttributes: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber762">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Remove an already existing index from a table</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">tableName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Table name to drop index from</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">indexNameOrAttributes</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Index name</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Query options</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-renameColumn">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">renameColumn</span><span data-ice="signature">(tableName: <span>String</span>, attrNameBefore: <span>String</span>, attrNameAfter: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber597">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Rename a column</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">tableName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Table name whose column to rename</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">attrNameBefore</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Current column name</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">attrNameAfter</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>New column name</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Query option</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-renameFunction">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">renameFunction</span><span data-ice="signature">(oldFunctionName: <span>String</span>, params: <span>Array</span>, newFunctionName: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber1303">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Rename SQL function</p>
<pre><code class="lang-js"><code class="source-code prettyprint">queryInterface.renameFunction(
  'fooFunction',
  [
    {type: 'varchar', name: 'param1', direction: 'IN'},
    {type: 'integer', name: 'param2', direction: 'INOUT'}
  ],
  'barFunction'
);</code>
</code></pre>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">oldFunctionName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">params</td>
      <td data-ice="type"><span>Array</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>List of parameters declared for SQL function</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">newFunctionName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-renameTable">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">renameTable</span><span data-ice="signature">(before: <span>String</span>, after: <span>String</span>, options: <span>Object</span>): <span>Promise</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber425">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Renames a table</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">before</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Current name of table</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">after</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>New name from table</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Query options</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-showAllSchemas">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">showAllSchemas</span><span data-ice="signature">(options: <span>Object</span>): <span>Promise</span>&lt;<span>Array</span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber77">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Show all schemas</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Query options</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span>&lt;<span>Array</span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-upsert">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span data-ice="name">upsert</span><span data-ice="signature">(tableName: <span>String</span>, insertValues: <span>Object</span>, updateValues: <span>Object</span>, where: <span>Object</span>, model: <span><a href="/v4/class/lib/model.js~Model.html">Model</a></span>, options: <span>Object</span>): <span>Promise</span>&lt;<span>created</span>, <span>primaryKey</span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v4/file/lib/query-interface.js.html#lineNumber919">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Upsert</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">tableName</td>
      <td data-ice="type"><span>String</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">insertValues</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>values to be inserted, mapped to field name</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">updateValues</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>values to be updated, mapped to field name</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">where</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>various conditions</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">model</td>
      <td data-ice="type"><span><a href="/v4/class/lib/model.js~Model.html">Model</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span>Object</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type" data-ice="returnType"><span>Promise</span>&lt;<span>created</span>, <span>primaryKey</span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
</div>
</div>

<footer class="footer">
  Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(0.5.2)</span><img src="/v4/./image/esdoc-logo-mini-black.png"></a>
</footer>



<script src="/v4/script/pretty-print.js"></script>



<script src="/v4/script/patch-for-local.js"></script>


</body></html>